<template>
    <div class="formalClass">
        <div class="experience_inputs">
            <div class="creatBtn">
                <creatFormal @refresh='doRefresh'></creatFormal>
            </div>
            <div class="operate_inputs">
                <el-form :inline="true" :model="formInline" class="demo-form-inline">
                    <el-form-item label="班级名称:">
                        <el-input v-model="formInline.key_word"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button class="search_btn" type="primary" @click="searchClassList"><i class="el-icon-search"></i>查询</el-button>
                    </el-form-item>
                </el-form>
            </div>
        </div>
        <el-table
            v-loading="loading2"
            element-loading-text="加载中..."
            :data="formalData"
            stripe 
            size="mini"
            border resizable
            style="width: 100%"
            :height="tableHeight">
            <el-table-column
                label="班级ID"
                prop="id"
                :align="align">
            </el-table-column>
            <el-table-column
                label="班级名称"
                prop="name"
                :align="align">
            </el-table-column> 
            <el-table-column
                label="助教"
                prop="_assistant_name"
                :align="align">
            </el-table-column>
            <el-table-column
                label="学员数"
                prop="total_student"
                :align="align">
            </el-table-column>
            <el-table-column
                label="备注"
                prop="remark"
                :align="align">
            </el-table-column>                    
            <el-table-column 
                align="center"
                min-width="360"
                label="班级操作">
                <template slot-scope="scope">
                    <el-button
                        size="mini"
                        @click="editClass(scope.row.id)">编辑班级</el-button>
                    <el-button
                        size="mini"
                        @click="classTable(scope.row.id)">班级课表</el-button>
                    <el-button
                        size="mini"
                        @click="removeClass(scope.row.id)">解散班级</el-button>
                </template>
            </el-table-column>
            <el-table-column 
                align="center"
                min-width="360"
                label="约课操作">
                <template slot-scope="scope">
                    <el-button
                        size="mini"
                        @click="reserverClass(scope.row.id)">连约正式课</el-button>
                    <el-button
                        size="mini"
                        @click="syAndClear(scope.row.id)">散约正式课</el-button>
                </template>
            </el-table-column>
        </el-table>

         <div class="page_block">
            <el-pagination
                background
                @current-change="handleCurrentChange"
                :current-page.sync="currentPage"
                :page-size="page_size"
                small
                layout="prev, pager, next, jumper"
                :total="totalCount">
            </el-pagination>
        </div>
        <!-- 编辑班级 -->
        <el-dialog title="编辑正式班" 
            width='beforeAddwidth'
            :modal=false
            :close-on-click-modal=false
            :visible.sync="dialogFormVisible1">
            <el-form :model="classDetail">
                <el-form-item label="班级名称："  :label-width="formLabelWidth">
                    <el-input v-model="classDetail.name" class='divided_200' auto-complete="off"></el-input>
                </el-form-item>
                <el-form-item label="销售：" :label-width="formLabelWidth">
                    <el-select v-model="classDetail.saleid">
                        <el-option v-for="(sale,j) in saleList" :key="j" :label="sale.realname" :value="sale.userid"></el-option>
                        <el-option label=" " value="0"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="线下中教：" :label-width="formLabelWidth">
                    <el-select v-model="classDetail.assistant">
                        <el-option v-for="(teacher,i) in teacherList" :key="i" :label="teacher.realname" :value="teacher.userid"></el-option>
                        <el-option label=" " value="0"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="班级备注：" :label-width="formLabelWidth">
                    <el-input v-model="classDetail.remark" auto-complete="off"></el-input>
                </el-form-item>
                <addtoClass 
                :allStudents='allStudents' 
                :classid="classid" 
                :classtype='classtype' 
                @refreshList="getStudentList"></addtoClass>
            </el-form>
            <el-table
                :data="studentList"
                stripe 
                size="mini"
                v-if='studentList'
                border resizable
                style="width: 100%;margin-left:60px;"
                max-height="656">
                 <el-table-column
                    label="学员账号"
                    prop="member.username"
                    :align="align"
                    :width="columWidth2">
                </el-table-column>
                <el-table-column
                    label="学员姓名"
                    prop="member.nickname"
                    :align="align"
                    :width="columWidth2">
                </el-table-column>
                <el-table-column label="学员性别" :align="align" :width="columWidth2">
                    <template slot-scope="scope">{{scope.row.member.gender==1?'男':'女'}} </template>
                </el-table-column> 
                <el-table-column
                    label="学员状态"
                    prop="member._status_name"
                    :align="align"
                    :width="columWidth2">
                </el-table-column>
                <el-table-column
                    label="录入人"
                    prop="member.agentAddPersonName"
                    :align="align"
                    :width="columWidth2">
                </el-table-column>   
                <el-table-column label="注册时间" :align="align" :width="columWidth2">
                    <template slot-scope="scope">{{scope.row.created_time | transData}} </template>
                </el-table-column>             
                <el-table-column 
                    fixed="right" 
                    :align="align"
                    min-width="200"
                    label="操作">
                    <template slot-scope="scope">
                        <el-button
                            size="mini"
                            @click="outClass(scope.row.classid,scope.row.member.userid)">移出班级</el-button>
                        <el-button
                            size="mini"
                            type="info" plain
                            @click="getFile(scope.row.member.userid,scope.row.member.ischild)">档案</el-button>
                    </template>
                </el-table-column>
            </el-table>

             <div>
                <el-dialog title="查看少儿学员资料" 
                    :close-on-click-modal=false 
                    v-if="ifchild" 
                    :modal=false
                    :visible.sync="dialogFormVisibleda">
                    <el-form :model="form">
                        <el-form-item label-width="80px">
                            <div class="member_info">学员信息</div>
                        </el-form-item>
                        <el-form-item label="昵称：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.nickname"></el-input>
                        </el-form-item>
                        <el-form-item label="手机号：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.mobile"></el-input>
                        </el-form-item>
                        <el-form-item label="真实姓名：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.fullname"></el-input>
                        </el-form-item>
                        <el-form-item label="发送信息给学员：" :label-width="formLabelWidth">
                            <el-radio-group disabled v-model="form.sendmail">
                                <el-radio label=1>是</el-radio>
                                <el-radio label=0>否</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="QQ：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.qq"></el-input>
                        </el-form-item>
                        <el-form-item label="SKype：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.skypenum" ></el-input>
                        </el-form-item>
                        <el-form-item label="Email：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.email"></el-input>
                        </el-form-item>
                        <el-form-item label="性别：" :label-width="formLabelWidth">
                            <el-radio-group  disabled v-model="form.gender">
                                <el-radio label=1>男</el-radio>
                                <el-radio label=0>女</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="出生日期：" :label-width="formLabelWidth">
                            <div class="block">
                                <el-date-picker
                                v-model="form.birthday"
                                type="date"
                                disabled
                                value-format="yyyy-MM-dd"
                                placeholder="选择日期">
                                </el-date-picker>
                            </div>
                        </el-form-item>
                        <el-form-item label="喜欢的动画片或玩具：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.toycartoon"></el-input>
                        </el-form-item>
                        <el-form-item label="所在年级：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.shoolPeriod" placeholder="选择学年" class="divided_3">
                                <el-option 
                                v-for="(sp,a) in childData.shoolperiod"
                                :key="a" :label="sp.attriname" 
                                :value="sp.attriid"></el-option>
                            </el-select>
                            <el-select disabled v-model="form.grade" placeholder="选择年级" class="divided_3">
                                <el-option v-for="(gradeitem,gd) in grade_lists" :key='gd' :label="gradeitem" :value="gd"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="性格特点：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.character" placeholder="选择性格">
                                <el-option 
                                v-for="(childcc,b) in childData.childcharacters"
                                :key="b" :label="childcc.attriname" :value="childcc.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="礼品邮寄地址：" :label-width="formLabelWidth">
                            <el-cascader
                                size="large"
                                disabled
                                :options="options"
                                v-model="form.address">
                            </el-cascader>
                            <el-input v-model="form.giftAddr" class="divided_200"></el-input>
                        </el-form-item>
                        <el-form-item :label-width="formLabelWidth" label="学习渠道：">
                            <el-checkbox-group disabled v-model="form.studyfrom">
                                <el-checkbox 
                                v-for="(studyf,d) in childData.studyfrom"
                                :key="d" :label="studyf.attriid">{{studyf.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item label-width="80px">
                            <div class="member_info">家庭信息</div>
                        </el-form-item>
                        <el-form-item label-width="80px">
                            <el-tag type="info">父亲信息</el-tag>
                        </el-form-item>
                        <el-form-item label="姓名：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.dadname"></el-input>
                        </el-form-item>
                        <el-form-item label="手机号：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.dadmobile"></el-input>
                        </el-form-item>
                        <el-form-item label="年龄：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.dadage"></el-input>
                        </el-form-item>
                        <el-form-item label="职业性质：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.dadjobs" placeholder="选择父亲职业">
                                <el-option 
                                v-for="(dadjob,e) in childData.jobs"
                                :key="e" :label="dadjob.attriname" :value="dadjob.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label-width="80px">
                            <el-tag type="info">母亲信息</el-tag>
                        </el-form-item>
                        <el-form-item label="姓名：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.mumname"></el-input>
                        </el-form-item>
                        <el-form-item label="手机号：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.mummobile"></el-input>
                        </el-form-item>
                        <el-form-item label="年龄：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.mumage"></el-input>
                        </el-form-item>
                        <el-form-item label="职业性质：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.mumjob" placeholder="选择母亲职业">
                                <el-option 
                                v-for="(mumjob,f) in childData.jobs"
                                :key="f" :label="mumjob.attriname" :value="mumjob.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="家庭收入：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.familyincome" placeholder="请选择">
                                <el-option 
                                v-for="(fain,g) in childData.familyincomes"
                                :key="g" :label="fain.attriname" :value="fain.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="是否已经开始学习英语：" :label-width="formLabelWidth">
                            <el-radio-group disabled  v-model="form.alreadystudy">
                                <el-radio label=1>是</el-radio>
                                <el-radio label=0>否</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item v-if='form.alreadystudy==1?true:false' label="学习了多久（单位：月）：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.studytime"></el-input>
                        </el-form-item>
                        <el-form-item v-if='form.alreadystudy==1?true:false' label="学习英语以哪种方式开始：" :label-width="formLabelWidth">
                            <el-radio-group disabled  v-model="form.stratway">
                                <el-radio 
                                v-for="(starw,h) in childData.startways"
                                :key="h" :label="starw.attriid">{{starw.attriname}}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item v-if='form.alreadystudy==1?true:false' label="是否接触过外教课程：" :label-width="formLabelWidth">
                            <el-radio-group disabled  v-model="form.withforeign">
                                <el-radio label=1>是</el-radio>
                                <el-radio label=0>否</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item v-if='form.withforeign==1?true:false' label="学习了多久（单位：月）：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.foreigntime"></el-input>
                        </el-form-item>
                        <el-form-item label="就读学校：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.schoolname"></el-input>
                        </el-form-item>
                        <el-form-item v-if='form.alreadystudy==1?true:false' label="孩子在校的英语成绩排名：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.englishrank" placeholder="选择排名">
                                <el-option 
                                v-for="(enrank,i) in childData.englishrank"
                                :key="i" :label="enrank.attriname" :value="enrank.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="孩子目前英语水平：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.englishlevel" placeholder="请选择">
                                <el-option 
                                v-for="(enlevel,j) in childData.englislevel"
                                :key="j" :label="enlevel.attriname" :value="enlevel.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="对孩子学习英语的期望：" :label-width="formLabelWidth">
                            <el-checkbox-group disabled v-model="form.expects">
                                <el-checkbox v-for="(expec,k) in childData.expects" :key="k" :label="expec.attriid" name="expects">{{expec.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item label="更希望孩子提升哪些方面：" :label-width="formLabelWidth">
                            <el-checkbox-group disabled v-model="form.improvefields">
                                <el-checkbox v-for="(impf,l) in childData.improvefields" :key="l" :label="impf.attriid" name="improvefields">{{impf.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item label="选择机构时首选考虑因素：" :label-width="formLabelWidth">
                            <el-radio-group disabled  v-model="form.considerfield">
                                <el-radio v-for="(consfi,m) in childData.considerfields" :key="m" :label="consfi.attriid">{{consfi.attriname}}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="每周预计投入学习时间：" :label-width="formLabelWidth">
                            <el-radio-group disabled  v-model="form.weekTime">
                                <el-radio v-for="(weekt,n) in childData.weektime" :key="n" :label="weekt.attriid">{{weekt.attriname}}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="适合孩子的上课时间：" :label-width="formLabelWidth">
                            <el-checkbox-group disabled v-model="form.suitabletime">
                                <el-checkbox v-for="(suitt,o) in childData.suitabletime" :key="o" :label="suitt.attriid" name="suitabletime">{{suitt.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item label="每月孩子学习英语的预算：" :label-width="formLabelWidth">
                            <el-radio-group disabled  v-model="form.monthbudget">
                                <el-radio ref="ref" v-for="(monthb,p) in childData.monthbudget" :key="p" :label="monthb.attriid">{{monthb.attriname}}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="希望完成课程时间：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.finishtime" placeholder="选择时间">
                                <el-option v-for="(studyshi,q) in childData.studyshijian" :key="q" :label="studyshi.attriname" :value="studyshi.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="预算：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.budget" placeholder="选择预算">
                                <el-option v-for="(studymon,r) in childData.studymoney" :key="r" :label="studymon.attriname" :value="studymon.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="学习诉求：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.appeal"></el-input>
                        </el-form-item>
                        <!-- <el-form-item label="第一次付费金额：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.firstpay" disabled></el-input>
                        </el-form-item> -->
                        <el-form-item label="老师寄语：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.teachernote"></el-input>
                        </el-form-item>
                        <el-form-item label="学员状态：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.status" placeholder="选择状态">
                                <el-option v-for="(membersta,s) in childData.memberStatusList" :key="s" :label="membersta.attriname" :value="membersta.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-form>
                    <!-- 回访记录 -->
                    <el-tag  class='recordStyle' type="info">回访记录</el-tag>
                    <el-table
                        :data="gotRecord"
                        stripe 
                        size="mini"
                        border resizable
                        style="width: 100%;margin-left:40px;"
                        max-height="656">
                        <el-table-column label="回访结果" :align="align" :width="240">
                            <template slot-scope="scope">{{scope.row.lev1}} {{scope.row.lev2}} {{scope.row.lev3}}</template>
                        </el-table-column>
                        <el-table-column label="回访内容" :align="align" :width="240">
                            <template slot-scope="scope">{{scope.row.content}}</template>
                        </el-table-column>
                        <el-table-column label="回访人" :align="align" :width="140">
                            <template slot-scope="scope">{{scope.row.agent ? scope.row.agent.realname:''}}</template>
                        </el-table-column>
                        <el-table-column label="回访时间" :align="align" :width="170">
                            <template slot-scope="scope">{{scope.row._time}}</template>
                        </el-table-column>
                    </el-table> 
                    <div slot="footer" class="dialog-footer">
                        <el-button class="dialog_close" @click="dialogFormVisibleda = false">关闭</el-button>
                    </div>
                </el-dialog>
            
                <el-dialog title="查看成人学员信息" 
                    :close-on-click-modal=false 
                    v-if="!ifchild" 
                    :modal=false
                    :visible.sync="dialogFormVisibleda">
                    <el-form :model="form" >
                        <el-form-item label="登录账号：" :label-width="formLabelWidth">
                            <el-input v-model="form.username" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="注册时间：" :label-width="formLabelWidth">
                            <el-input v-model="form.regdate" disabled></el-input>
                        </el-form-item>
                            <el-form-item label="上次登陆时间：" :label-width="formLabelWidth">
                            <el-input v-model="form.lastdate" disabled></el-input>
                        </el-form-item>
                            <el-form-item label="登录次数：" :label-width="formLabelWidth">
                            <el-input v-model="form.loginnum" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="昵称：" :label-width="formLabelWidth">
                            <el-input v-model="form.nickname" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="真实姓名：" :label-width="formLabelWidth">
                            <el-input v-model="form.fullname" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="手机：" :label-width="formLabelWidth">
                            <el-input v-model="form.mobile" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="Email：" :label-width="formLabelWidth">
                            <el-input v-model="form.email" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="性别：" :label-width="formLabelWidth">
                            <el-radio-group  v-model="form.gender" disabled>
                                <el-radio label=1>男</el-radio>
                                <el-radio label=0>女</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="大学：" :label-width="formLabelWidth">
                            <el-input v-model="form.daxue" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="专业：" :label-width="formLabelWidth">
                            <el-input v-model="form.zhuanye" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="公司：" :label-width="formLabelWidth">
                            <el-input v-model="form.gongsi" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="行业：" placeholder="选择一项行业" :label-width="formLabelWidth">
                            <el-select v-model="form.job" disabled>
                                <el-option v-for="(jobitem,c) in fromLabel.job" :key="c" :label="jobitem.attriname" :value="jobitem.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="职位：" :label-width="formLabelWidth">
                            <el-input v-model="form.zhiwei" disabled></el-input>
                        </el-form-item>
                        
                        <el-form-item label="公司网站：" :label-width="formLabelWidth">
                            <el-input v-model="form.gongsiwangzhi" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="公司电话：" :label-width="formLabelWidth">
                            <el-input v-model="form.gongsidianhua" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="公司人事联系人：" :label-width="formLabelWidth">
                            <el-input v-model="form.lianxiren" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="qq" :label-width="formLabelWidth">
                            <el-input v-model="form.qq" disabled></el-input>
                        </el-form-item>  
                        <el-form-item label="SKype：" :label-width="formLabelWidth">
                            <el-input v-model="form.skypenum" disabled></el-input>
                        </el-form-item>  
                        <el-form-item label="分类：" :label-width="formLabelWidth">
                            <el-radio-group  disabled v-model="form.isfirststudy">
                                <el-radio label=0>第一次学习</el-radio>
                                <el-radio label=1>上过体验课</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="年龄段：" placeholder="选取年龄段" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.age">
                                <el-option v-for="(ageitem,a) in fromLabel.age" :key="a" :label="ageitem.attriname" :value="ageitem.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item :label-width="formLabelWidth" label="学习渠道：">
                            <el-checkbox-group disabled v-model="form.studyfrom">
                                <el-checkbox v-for="(studyfitem,g) in fromLabel.studyfrom" :key="g" :label="studyfitem.attriid" name="studyfrom">{{studyfitem.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item label="英语水平：" placeholder="选取英语水平" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.studylevel">
                                <el-option v-for="(slitem,b) in fromLabel.studylevel" :key="b" :label="slitem.attriname" :value="slitem.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="英语分数：" :label-width="formLabelWidth">
                            <el-input v-model="form.highscore" disabled class="divided_2"></el-input>
                        </el-form-item>                     
                        <el-form-item :label-width="formLabelWidth" label="学习英语第一目标-课程：">
                            <el-checkbox-group disabled v-model="form.wanttostudy">
                                <el-checkbox v-for="(ccitem,d) in fromLabel.curriculumType" :key="d" :label="ccitem.id" name="curriculumType">{{ccitem.title}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item :label-width="formLabelWidth" label="学习英语第二目标-方面：">
                            <el-checkbox-group disabled v-model="form.studyhigh">
                                <el-checkbox v-for="(studyhitem,e) in fromLabel.studyhigh" :key="e" :label="studyhitem.attriid" name="studyhigh">{{studyhitem.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item :label-width="formLabelWidth" label="学习英语第三目标-知识：">
                            <el-checkbox-group disabled v-model="form.studyextension">
                                <el-checkbox v-for="(studyexitem,f) in fromLabel.studyextension" :key="f" :label="studyexitem.attriid" name="studyextension">{{studyexitem.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item label="希望完成课程时间：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.studyshijian">
                                <el-option v-for="(stshiitem,h) in fromLabel.studyshijian" :key="h" :label="stshiitem.attriname" :value="stshiitem.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="预算：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.studymoney">
                                <el-option v-for="(stmitem,i) in fromLabel.studymoney" :key="i" :label="stmitem.attriname" :value="stmitem.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="学员评测等级：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.level">
                                <el-option v-for="(studylevel,j) in fromLabel.StudentEvaluationGrade" :key="j" :label="'level'+studylevel.attriname" :value="studylevel.attriname"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="学员目标等级：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.targetlevel">
                                <el-option v-for="(studylevel,k) in fromLabel.StudentEvaluationGrade" :key="k" :label="'level'+studylevel.attriname" :value="studylevel.attriname"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="学习诉求：" :label-width="formLabelWidth">
                            <el-input v-model="form.iwant" disabled class="divided_2"></el-input>
                        </el-form-item> 
                        <el-form-item label="学员分组：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.groupid">
                                <el-option v-for="(mgitem,l) in fromLabel.member_group" :key="l" :label="mgitem.name" :value="mgitem.groupid"></el-option>
                            </el-select>
                        </el-form-item>
                        <!-- <el-form-item label="第一次付费金额：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.firstpay" class="divided_2"></el-input>
                        </el-form-item>  -->
                        <el-form-item label="老师寄语：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.tutorcomment" class="divided_2"></el-input>
                        </el-form-item> 
                        <el-form-item label="学员状态：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.status" placeholder="选择状态">
                                <el-option v-for="(membersta,s) in fromLabel.memberStatusList" :key="s" :label="membersta.attriname" :value="membersta.attriid"></el-option>
                            </el-select>
                        </el-form-item>   
                    </el-form>
                     <!-- 回访记录 -->
                    <el-tag  class='recordStyle' type="info">回访记录</el-tag>
                    <el-table
                        :data="gotRecord"
                        stripe 
                        size="mini"
                        border resizable
                        style="width: 100%;margin-left:40px;"
                        max-height="656">
                        <el-table-column label="回访时间" :align="align" :width="170">
                            <template slot-scope="scope">{{scope.row.time | transData}}</template>
                        </el-table-column>
                        <el-table-column label="回访内容" :align="align" :width="240">
                            <template slot-scope="scope">{{scope.row.content}}</template>
                        </el-table-column>
                        <el-table-column label="回访人" :align="align" :width="170">
                            <template slot-scope="scope">{{scope.row.agent ? scope.row.agent.realname:''}}</template>
                        </el-table-column>
                        <el-table-column label="回访结果" :align="align" :width="240">
                            <template slot-scope="scope">
                                {{scope.row.lev1}}{{scope.row.lev2?'-':''}}{{scope.row.lev2}}{{scope.row.lev3?'-':''}}{{scope.row.lev3}}
                            </template>
                        </el-table-column>
                    </el-table>
                    <div slot="footer" class="dialog-footer">
                        <el-button class="dialog_close" @click="dialogFormVisibleda = false">关闭</el-button>
                    </div>
                </el-dialog>
                
            </div>
            <div slot="footer" class="dialog-footer">
                <el-button class="dialog_close" @click="dialogFormVisible1=false">取 消</el-button>
                <el-button class="dialog_confirm" type="primary" @click="submitEdit">确 定</el-button>
            </div>
        </el-dialog> 

        <!-- 查看课表 -->
        <el-dialog title="查看课表" 
            width='82%'
            :modal=false
            :close-on-click-modal=false
            :visible.sync="dialogFormVisible8">
            <el-button
                icon='el-icon-arrow-left'
                size='mini'
                style="margin-bottom:6px;"
                @click="backTable"></el-button>
            <el-button
                icon='el-icon-arrow-right'
                size='mini'
                style="margin-bottom:6px;"
                @click="nextTable"></el-button>
            <el-table
                :data="experienceData2"
                stripe 
                size="mini"
                border resizable
                style="width: 100%"
                max-height="656">
                <el-table-column label="课程ID" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.courseid}} </template>
                </el-table-column>
                <el-table-column label="学校" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row._school_name}} </template>
                </el-table-column>
                <el-table-column label="班级" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.class.name}} </template>
                </el-table-column>
                <el-table-column label="中教" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.class.assistant}} </template>
                </el-table-column>
                <el-table-column label="上课时间" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.classSchedule.starttime | transData}} </template>
                </el-table-column>
                <el-table-column label="外教" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.snap.teachername}} </template>
                </el-table-column> 
                <el-table-column label="教材" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.class.name}} </template>
                </el-table-column>
                <el-table-column label="课程性质" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.classSchedule.classtype==1?'体验班':'正式班'}} </template>
                </el-table-column>                  
            </el-table>
            <div slot="footer" class="dialog-footer">
                <el-button class="dialog_close" @click="dialogFormVisible8=false">取 消</el-button>
                <el-button class="dialog_confirm" type="primary" @click="dialogFormVisible8=false">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 预约正式课 -->
        <el-dialog title="预约正式课" 
            width='54%'
            :modal=false
            :close-on-click-modal=false
            :visible.sync="dialogFormVisible2">
            <el-form :model="form1">
                <el-form-item label="选择班级：" :label-width="formLabelWidth">
                    <el-select v-model="form1.classid" disabled>
                        <el-option 
                            v-for="(cs,s) in classSelect"
                            :key="s" :label="cs.name" :value="cs.id"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="学期长度：" :label-width="formLabelWidth">
                    <el-input v-model="form1.termlen" class='divided_3'></el-input>周
                    <!-- <span class="eg_tip">(例：每周4节课，约16周，总节数为64节)</span> -->
                    <el-button style='margin-left:100px;' type="info" @click='syAndClear' plain>散约正式课</el-button>
                </el-form-item>
                <el-form-item label="开始日期：" :label-width="formLabelWidth">
                    <el-date-picker 
                    type="date" placeholder="选择日期" 
                    v-model="form1.startdate" 
                    value-format="yyyy-MM-dd"
                    style="width:200px;"></el-date-picker>
                </el-form-item>
                <el-form-item label="每周上课时间：" :label-width="formLabelWidth">
                    <el-button type="info" @click='addTime' plain style="margin-right:300px;">增加</el-button>
                    <!-- 是否跳过节假日<el-radio v-model="form1.passholiday" label="1">是</el-radio>
                    <el-radio v-model="form1.passholiday" label="0">否</el-radio> -->

                    <el-button 
                        @click="getCourseTime"
                        el-button class="dialog_confirm" 
                        type="primary">确认上课时间</el-button>
                </el-form-item>
                <el-form-item :label-width="formLabelWidth" v-for='(item,index) in form1.timeArr' :key="index">
                    <el-select class="divided_3" v-model="item.timeperweek1" placeholder="星期几">
                        <el-option 
                            v-for="(wk,z) in weekarr"
                            :key="z" :label="wk.title" :value="wk.id"></el-option>
                    </el-select>
                    <el-select class="divided_3" v-model="item.timeperweek2" placeholder="课程时间">
                        <el-option 
                            v-for="(hr,y) in hourarr"
                            :key="y" :label="hr" :value="y"></el-option>
                    </el-select>
                    <el-button type="danger" @click='delRow(index)' plain>删除</el-button>
                </el-form-item>
                
                <!-- 查看开课列表 -->
                <el-table
                    :data="form1.testTime"
                    v-if='kkTable'
                    stripe 
                    size="mini"
                    border resizable
                    style="width: 90%;margin-left:60px;"
                    max-height="724">
                    <el-table-column label="上课日期" :align="align" :width="columWidth">
                        <template slot-scope="scope">
                            {{scope.row | transYear}}
                        </template>
                    </el-table-column> 
                    <el-table-column label="上课时间" :align="align" :width="columWidth">
                        <template slot-scope="scope">
                            {{scope.row | transHour}}
                        </template>
                    </el-table-column>           
                    <el-table-column 
                        fixed="right" 
                        align="center"
                        min-width="260"
                        label="操作">
                        <template slot-scope="scope">
                            <el-button
                                size="mini"
                                @click='cancleTime(scope.$index,scope.row)'>删除上课时间</el-button>
                            <el-button
                                size="mini"
                                @click="changeClassTime(scope.$index)">修改上课时间</el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <el-form-item style="border-bottom:1px solid #ebeef5;" :label-width="'74%'" v-if='kkTable'>
                    <el-button 
                        el-button class="dialog_confirm" 
                        size="mini"
                        style="margin:10px 0;"
                        @click='checkCourse'
                        type="primary">确认最终上课时间</el-button>
                </el-form-item>
                <el-form-item label="外教地区：" :label-width="formLabelWidth">
                    <el-radio-group v-model="form1.areaid">
                        <el-radio v-for="(aitem,qy) in area" :key='qy' 
                        :label="aitem.attriid">{{aitem.attriname}}</el-radio>
                        <!-- <el-radio :label="0">不限</el-radio> -->
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="学习计划：" :label-width="formLabelWidth">
                    <el-select class="divided_3" v-model="course1id" @change="course1Change" placeholder="第一级">
                        <el-option 
                            v-for="(c1,f) in course1"
                            :key="f" :label="c1.title" :value="c1.id"></el-option>
                    </el-select>
                    <el-select class="divided_3" v-if='c2show' v-model="course2id" @change="course2Change" placeholder="第二级">
                        <el-option 
                            v-for="(c2,s) in course2"
                            :key="s" :label="c2.title" :value="c2.id"></el-option>
                    </el-select>
                    <el-select class="divided_3" v-if='c3show' v-model="course3id" @change="course3Change" placeholder="第三级">
                         <el-option 
                            v-for="(c3,t) in course3"
                            :key="t" :label="c3.title" :value="c3.id"></el-option>
                    </el-select>
                    <el-select class="divided_3" v-if='c4show' v-model="course4id" @change="course4Change" placeholder="第四级">
                         <el-option 
                            v-for="(c4,fo) in course4"
                            :key="fo" :label="c4.title" :value="c4.id"></el-option>
                    </el-select>
                    <el-select class="divided_3" v-if='c5show' v-model="course5id" @change="course5Change" placeholder="第五级">
                         <el-option 
                            v-for="(c5,fi) in course5"
                            :key="fi" :label="c5.title" :value="c5.id"></el-option>
                    </el-select>
                    <el-select class="divided_3" v-if='c6show' v-model="course6id" @change="course6Change" placeholder="第六极">
                         <el-option 
                            v-for="(c6,si) in course6"
                            :key="si" :label="c6.title" :value="c6.id"></el-option>
                    </el-select>
                </el-form-item>
                 <el-form-item :label-width="'60px'">
                    <div style='color:#ff5263;'>
                        点击左侧的教材名称添加至右侧学习计划，默认按照学习计划中教材顺序上课,拖住学习计划可上下调整学习计划
                    </div>
                 </el-form-item>
                <el-form-item :label-width="'100px'">
                   
                    <div class="tuozhuai">
                        <div class="kejian">
                            <div class="differ">教材</div>
                            <div v-for='(transItem,transIndex) in transferdata' 
                            :key='transIndex' @click='addItem(transItem.id,transItem.title)'>
                                {{transItem.title}}
                            </div>    
                        </div>
                        <div class="plan-list">
                            <div class="differ">开课计划</div>
                            <draggable v-model="tags" :move="getdata" @update="datadragEnd">
                                <transition-group>
                                    <div class="testdiv" v-for="(planite,index2) in tags" :key="index2+'plan'">
                                        {{planite.name}}
                                        <el-button 
                                        icon='el-icon-circle-close-outline'
                                        @click='removeItem(index2)'
                                        class='circle_close'></el-button>
                                    </div>
                                </transition-group>
                            </draggable>
                        </div>  
                    </div>
                </el-form-item>
                <el-form-item label-width="80px">
                    <el-tag type="info">附加选项</el-tag>
                </el-form-item>
                <el-form-item label="上课工具：" :label-width="formLabelWidth">
                    <el-select v-model="form1.classtool">
                        <el-option v-for="(tool,gj) in form1.classTool" :key='gj' 
                        :label="tool.attriname" :value="tool.attriid"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="填写号码：" :label-width="formLabelWidth">
                    <el-input class="divided_2" v-model='form1.classtoolnum'></el-input>
                </el-form-item>
                <!-- <el-form-item label="外教性别：" :label-width="formLabelWidth">
                   <el-radio-group v-model="form.gender">
                        <el-radio label='0'>无需求</el-radio>
                        <el-radio label='1'>男</el-radio>
                        <el-radio label='2'>女</el-radio>
                    </el-radio-group>
                </el-form-item> -->
                <!-- <el-form-item label="中文要求：" :label-width="formLabelWidth">
                    <el-select v-model="form.chineselevel">
                        <el-option v-for="(clevel,zw) in chineselevel" :key='zw' 
                        :label="clevel.attriname" :value="clevel.attriid"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="专业背景：" :label-width="formLabelWidth">
                    <el-select v-model="form.professional" placeholder="外教工作背景">
                        <el-option v-for="(pro,zy) in professional" :key='zy' 
                        :label="pro.attriname" :value="pro.attriid"></el-option>
                        <el-option label="不限" value="0"></el-option>
                    </el-select>
                </el-form-item>  -->
                <el-form-item class='searchTeacher'>
                    <el-button type="danger" @click="searchTeacher" 
                        :disabled=searchBtn
                        plain><i class="el-icon-search"></i>搜索外教</el-button>
                </el-form-item> 
            </el-form>

            <!-- 添加成功后展示老师信息 -->
            <teacherCardF @changeDia='dialogChange' :avaTeacher='avaTeacher' :form='form1'></teacherCardF>
            
            <div class="page_blocksy" v-if='pageDivide'>
                <el-pagination
                    background
                    @current-change="handleCurrentChange3"
                    :current-page.sync="currentPage3"
                    :page-size="page_size2"
                    small
                    layout="prev, pager, next, jumper"
                    :total="totalCount3">
                </el-pagination>
            </div>

            <div slot="footer" class="dialog-footer">
                <el-button class="dialog_confirm" type="primary" @click="closeAndClear">关闭</el-button>
            </div> 
        </el-dialog> 

        <!-- 改签时间 -->
        <el-dialog title="改签时间" 
            width='54%'
            :modal=false
            :close-on-click-modal=false
            :visible.sync="dialogFormVisiblegq">
            <el-form>
                <div class='timeLimitTip'>
                    改签时间只能在此学期内({{timeLimit.startTime | transYear}} —— {{timeLimit.endTime | transYear}})
                </div>
                <el-form-item label="上课时间：" :label-width="formLabelWidth">
                    <el-date-picker 
                        type="date" placeholder="开始日期" 
                        v-model="newStartDate" 
                        value-format="yyyy-MM-dd"
                        style="width:200px;">
                    </el-date-picker>
                    <el-select class="divided_3" v-model="newTimePoint" placeholder="课程时间">
                        <el-option 
                            v-for="(hr,y) in hourarr"
                            :key="y" :label="hr" :value="y"></el-option>
                    </el-select>
                </el-form-item>
                <!-- <el-form-item :label-width="formLabelWidth"> -->
                    
                <!-- </el-form-item> -->
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button class="dialog_confirm" type="primary" @click="changeTime">确认</el-button>
                <el-button class="dialog_confirm" type="primary" @click="dialogFormVisiblegq=false">取消</el-button>
            </div> 
        </el-dialog> 

        <!-- 散约正式课 -->
        <el-dialog title="散约正式课" 
            width='54%'
            :modal=false
            :close-on-click-modal=false
            :visible.sync="SdialogFormVisible">
            <el-form :model="form1">
                <el-form-item label="选择班级：" :label-width="formLabelWidth">
                    <el-select v-model="form1.classid" disabled>
                        <el-option 
                            v-for="(cs,s) in classSelect"
                            :key="s" :label="cs.name" :value="cs.id"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="筛选时间：" :label-width="formLabelWidth">
                    <el-date-picker 
                        type="datetime" placeholder="开始日期" 
                        v-model="form1.startdate" 
                        value-format="yyyy-MM-dd HH:mm:ss"
                        style="width:200px;"></el-date-picker>
                    <el-date-picker 
                        type="datetime" placeholder="结束日期" 
                        v-model="form1.enddate" 
                        value-format="yyyy-MM-dd HH:mm:ss"
                        style="width:200px;"></el-date-picker>
                </el-form-item>
                 <el-form-item label="外教地区：" :label-width="formLabelWidth">
                    <el-radio-group v-model="form1.areaid">
                        <el-radio v-for="(aitem,qy) in area" :key='qy' 
                        :label="aitem.attriid">{{aitem.attriname}}</el-radio>
                        <!-- <el-radio :label="0">不限</el-radio> -->
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="上课教材：" :label-width="formLabelWidth">
                    <el-select class="divided_3 bottom_4" v-model="course1id" @change="course1Change" placeholder="第一级">
                        <el-option 
                            v-for="(c1,f) in course1"
                            :key="f" :label="c1.title" :value="c1.id"></el-option>
                    </el-select>
                    <el-select class="divided_3 bottom_4" v-if='c2show' v-model="course2id" @change="course2Change" placeholder="第二级">
                        <el-option 
                            v-for="(c2,s) in course2"
                            :key="s" :label="c2.title" :value="c2.id"></el-option>
                    </el-select>
                    <el-select class="divided_3 bottom_4" v-if='c3show' v-model="course3id" @change="course3Change" placeholder="第三极">
                         <el-option 
                            v-for="(c3,t) in course3"
                            :key="t" :label="c3.title" :value="c3.id"></el-option>
                    </el-select>
                    <el-select class="divided_3 bottom_4" v-if='c4show' v-model="course4id" @change="course4Change" placeholder="第四极">
                         <el-option 
                            v-for="(c4,fo) in course4"
                            :key="fo" :label="c4.title" :value="c4.id"></el-option>
                    </el-select>
                    <el-select class="divided_3 bottom_4" v-if='c5show' v-model="course5id" @change="course5Change" placeholder="第五极">
                         <el-option 
                            v-for="(c5,fi) in course5"
                            :key="fi" :label="c5.title" :value="c5.id"></el-option>
                    </el-select>
                    <el-select class="divided_3 bottom_4" v-if='c6show' v-model="course6id"  @change="course6Change" placeholder="第六极">
                         <el-option 
                            v-for="(c6,si) in course6"
                            :key="si" :label="c6.title" :value="c6.id"></el-option>
                    </el-select>
                </el-form-item>
                
                <el-form-item label-width="80px">
                    <el-tag type="info">附加选项</el-tag>
                </el-form-item>
                <el-form-item label="上课工具：" :label-width="formLabelWidth">
                    <el-select v-model="form1.classtool" placeholder='请选择上课工具'>
                        <el-option v-for="(tool,gj) in form1.classTool" :key='gj' 
                        :label="tool.attriname" :value="tool.attriid"></el-option>
                    </el-select>
                </el-form-item>
                
                <!-- <el-form-item label="外教性别：" :label-width="formLabelWidth">
                   <el-radio-group v-model="form.gender">
                        <el-radio label='1'>男</el-radio>
                        <el-radio label='2'>女</el-radio>
                        <el-radio label='0'>无需求</el-radio>
                    </el-radio-group>
                </el-form-item> -->
                <!-- <el-form-item label="中文要求：" :label-width="formLabelWidth">
                    <el-select v-model="form.chineselevel" placeholder='外教中文水平'>
                        <el-option v-for="(clevel,zw) in chineselevel" :key='zw' 
                        :label="clevel.attriname" :value="clevel.attriid"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="专业背景：" :label-width="formLabelWidth">
                    <el-select v-model="form.professional" placeholder="外教工作背景">
                        <el-option v-for="(pro,zy) in professional" :key='zy' 
                        :label="pro.attriname" :value="pro.attriid"></el-option>
                    </el-select>
                </el-form-item>  -->
                <el-form-item class='searchTeacher'>
                    <el-button type="danger" @click="syTeacher" plain><i class="el-icon-search"></i>查询</el-button>
                </el-form-item> 
            </el-form>

             <!-- 添加成功后展示老师信息 -->
            <teacherCardSy  @changeDia='dialogChange' :avaTeacher2='avaTeacher2' :form='form1'></teacherCardSy>
            
             <div class="page_blocksy" v-if='pageDivide'>
                <el-pagination
                    background
                    @current-change="handleCurrentChange2"
                    :current-page.sync="currentPage2"
                    :page-size="page_size2"
                    small
                    layout="prev, pager, next, jumper"
                    :total="totalCount2">
                </el-pagination>
            </div>

            <div slot="footer" class="dialog-footer">
                <el-button class="dialog_confirm" type="primary" @click="clearSanyue">关闭</el-button>
            </div> 
        </el-dialog> 
        
    </div>
</template>

<script>
    import addtoClass from '../components/buttons/addToClass'
    import creatFormal from '../components/buttons/creatFormal.vue'
    import teacherCardF from '../components/teacherCardF.vue'
    import teacherCardSy from '../components/teacherCardSy.vue'
    import base from '../api/base.js'
    import {formatDate} from '../../static/js/date.js'
    import { regionData } from 'element-china-area-data'
    import draggable from 'vuedraggable';
    export default {
        components:{
            addtoClass,creatFormal,teacherCardF,teacherCardSy,draggable
        },
        data() {
            return {
                tableHeight:window.innerHeight-300,
                loading2:true,
                // 新增
                timeStamp:'',
                newStartDate:'',
                newTimePoint:'',
                kkTable:false,//开课时间表格
                timeLimit:{},
                tags: [],
                dialogFormVisiblegq:false,
                gqindex:'',
                searchBtn:true,//是否可搜索

                // 档案、移除班级等
                allStudents:[],
                userid:'',
                ifchild:'',
                userInfo:[],
                fromLabel:[],
                childData:[],
                //回访记录
                gotRecord:[],
                // 省市区
                options: regionData,
                // 获取的年级列表
                grade_lists:'',


                classtype:'formal',
                //教师卡片
                avaTeacher:[],//可用老师列表
                availableTeacher:[],//散约
                avaTeacher2:[],
                rclassData:'',//约课信息
                classid:'',
                // addedTable:'',//添加成功后展示表格
                // 单个正式班信息
                classDetail:{
                    name:'',
                    assistant:'',
                    saleid:'',
                    remark:''
                },
                teacherList:[],
                saleList:[],
                // 老师属性
                professional:[],
                chineselevel:[],
                area:[],
                // 分页数据
                totalCount:0,
                currentPage: 1,
                cur_page:1,
                page_size:16,
                // 散约课老师列表分页
                pageDivide:false,
                totalCount2:0,
                currentPage2: 1,
                cur_page2:1,
                page_size2:8,
                // 散约课老师列表分页
                totalCount3:0,
                currentPage3: 1,
                cur_page3:1,
                
                formInline: {
                    key_word: '',
                    range:'',
                },
                // 预约体验课表单
                reserveData:{
                    material:"",
                    classTime:'',
                    teacherArea:'',
                    sexNeed:'',
                    toolNeed:'',
                    chineseNeed:''
                },
                beforeAddwidth:'60%',
                dialogFormVisible1:false,//编辑班级
                dialogFormVisible2:false,//约课
                dialogFormVisible3:false,//确认约课信息
                dialogFormVisible8:false,//查看課表
                dialogFormVisibleda:false,//档案
                experienceData2:[],
                //课表时间
                date_time:'',
                groupclassid:'',
                now_date:'',

                columWidth:200,
                formLabelWidth: '160px',
                columWidth2:140,
                align:'center',
                courseid:0,//课程id
                course1:'',
                course1id:'',
                course2:'',
                course2id:'',
                course3:'',
                course3id:'',
                course4:'',
                course4id:'',
                course5:'',
                course5id:'',
                course6:'',
                course6id:'',
                course7:'',
                course7id:'',
                c2show:false,
                c3show:false,
                c4show:false,
                c5show:false,
                c6show:false,
                classSelect:[],
                form1: {
                    // 新增
                    testTime: [],
                    sendArry:[],

                    passholiday:'',
                    classTool:[],
                     // 搜索老师表单
                    classid:'',
                    areaid:1318,
                    gender:'',
                    classtool:'',
                    chineselevel:'',
                    professional:'',
                    startdate:'',
                    enddate:'',
                    coursewareid:'',
                    termlen:'',
                    studyplan:[],
                    passholiday:'',
                    changeid:'',
                    timeArr:[{
                        timeperweek1:'',
                        timeperweek2:'',
                        timeperweek:''
                    }],
                    tpArr:[],
                    tpArr2:[],
                    tpArr3:[],
                    // tpArr:['2-3','1-1','3-12']
                    classtoolnum:'',
                },
                form: {
                     //  =======================================成人表单数据
                    nickname:'',
                    new_pwd:'',
                    fullname:'',
                    mobile:'',
                    email:'',
                    gender:'',
                    face:'',
                    daxue:'',
                    zhuanye:'',
                    gongsi:'',
                    job:'',
                    zhiwei:'',
                    gongsiwangzhi:'',
                    gongsidianhua:'',
                    lianxiren:'',
                    qq:'',
                    skypenum:'',
                    isfirststudy:'',
                    age:'',
                    studylevel:'',
                    highscore:'',
                    province:'',
                    cityname:'',
                    district:'',
                    wanttostudy:[],
                    studyhigh:[],
                    studyextension:[],
                    // studyfrom:[],
                    studyshijian: '',
                    StudentEvaluationGrade:'',
                    level: '',
                    targetlevel:'',
                    iwant: '',
                    groupid:'',
                    firstpay:'',
                    tutorcomment: '',
                    status:'',
                    //  =======================================少儿
                    username:'',
                    regdate:'',
                    lastdate:'',
                    loginnum:'',
                    new_pwd:'',
                    // nickname: '',
                    mobile:'',
                    fullname: '',
                    sendmail:'',
                    // qq: '',
                    // skypenum:'',
                    email: '',
                    gender:'',
                    birthday: '',
                    toycartoon:'',
                    shoolPeriod: '',//学年
                    xuenianid:'',
                    grade:'',//年级
                    character:'',
                    avatar:'',
                    // province: '',//省
                    // cityname:'',//市
                    // district: '',//区
                    giftAddr:'',
                    studyfrom:[],//学习渠道
                    dadname:'',//父亲
                    dadmobile:'',
                    dadage:'',
                    dadjob:'',
                    mumname:'',//母亲
                    mummobile:'',
                    mumage: '',
                    mumjob:'',
                    familyincome: '',//家庭收入
                    alreadystudy:'',
                    studytime:'',
                    stratway:'',
                    withforeign:'',//是否接触其他外教课程
                    foreigntime:'',
                    schoolname:'',
                    englishrank:'',
                    englishlevel:'',
                    expects:[], 
                    improvefields:[],
                    considerfield:'',//考虑方面
                    weekTime:'',
                    suitabletime:[],
                    monthbudget:'',
                    finishtime:'',
                    budget:'',
                    appeal:'',
                    teachernote:'',
                    state:'',
                    delivery: false, 
                    address:[]
                },
                weekarr:[
                    {
                        title:'星期一',
                        id:'1'
                    },
                    {
                        title:'星期二',
                        id:'2'
                    },
                    {
                        title:'星期三',
                        id:'3'
                    },
                     {
                        title:'星期四',
                        id:'4'
                    },
                    {
                        title:'星期五',
                        id:'5'
                    },
                    {
                        title:'星期六',
                        id:'6'
                    },
                    {
                        title:'星期日',
                        id:'7'
                    }
                ],
                hourarr:['0点','1点','2点','3点','4点','5点','6点','7点','8点','9点','10点','11点','12点','13点','14点',
                '15点','16点','17点','18点','19点','20点','21点','22点','23点','24点'],
                // 正式班管理表格
                formalData: [],
                // 添加完的学员信息表格
                studentList:[],
                //穿梭框数据
                transferdata:[],
                originData:[],
                // chosedValue: [4],
                SdialogFormVisible:false  ,
                removeTip:'确定解散班级',
            };
           
        },
        methods: {
            checkCourse(){
                this.$axios({
                    url: base.baseUrl+"/school/course/check-course-time",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        timeList:this.form1.testTime
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==-1){
                        this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.searchBtn=false
                    }
                })
            },
            // 新增
            getdata(evt) {
				console.log(evt.draggedContext.element.id)
			},
			datadragEnd(evt) {
				// console.log('拖动前的索引 :' + evt.oldIndex)
				// console.log('拖动后的索引 :' + evt.newIndex)
                console.log(this.tags)
                this.giveSendArr()
			},
            addItem(kid,value){
                var lists=[]
                lists.push({
                    name:value,
                    id:kid
                })
                this.tags=this.tags.concat(lists)
                // console.log(this.tags)
                this.giveSendArr()
            },
            giveSendArr(){
                this.form1.sendArry=[]
                this.tags.map((titem,tindex)=>{
                    this.form1.sendArry.push(titem.id)
                })
            },
            removeItem(e){
                console.log(e)
                this.tags.splice(e,1)
                this.form1.sendArry.splice(e,1)
            },
            // 获取开课时间
            getCourseTime(){
                this.forTparr()
                this.$axios({
                    url: base.baseUrl+"/school/course/get-course-time",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        startdate:this.form1.startdate,
                        timeperweek:this.form1.tpArr2,
                        termlen:this.form1.termlen,
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    this.form1.tpArr3=this.form1.tpArr2    
                    this.form1.tpArr = []
                    this.form1.tpArr2 = []
                    if(res.data.code==-1){
                        this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.kkTable=true
                        this.form1.testTime=(res.data.data.timeList).sort()
                        this.timeLimit=res.data.data.termInfo
                    } 
                    
                });
            },
            // 取消课程
            cancleTime(index,row){
                this.$alert('确定取消课程？', '提示', {
                    confirmButtonText: '确定',
                    callback: action => {
                       this.form1.testTime.splice(index,1)
                       this.alertTip('课程取消成功')
                    }
                });
            },
            changeClassTime(ind){
                this.gqindex=ind
                this.dialogFormVisiblegq=true
                this.newStartDate=this.newTimePoint=''
            },
            // 改签课程
            changeTime(){
                if(this.newTimePoint<10){
                    this.newTimePoint='0'+this.newTimePoint+":00:00"
                }else{
                    this.newTimePoint=this.newTimePoint+':00:00'
                }
                var chooseTime=this.newStartDate+' '+this.newTimePoint

                var datet=new Date(chooseTime.replace(/-/g, '/'))
                this.timeStamp=datet.getTime()/1000
                this.form1.testTime.push(this.timeStamp)
                this.form1.testTime.splice(this.gqindex,1)

                this.dialogFormVisiblegq=false
                this.alertTip('修改成功')
            },
            
// ===================================================================================
            // 获取回访记录
            getFile(uid,ischild){
                this.dialogFormVisibleda=true;
                this.userid=uid;
                if(ischild==1){
                   this.ifchild=true;
                }else{
                    this.ifchild=false
                }
                this.getUserInfo()
                this.getRecord()
                this.getAdultform()
                this.getChildform()
                this.getGrade()
            },
            // 获取学员信息
            getUserInfo(){
                this.$axios({
                    url: base.baseUrl+"/school/member/get-student-info",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        userid:this.userid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==-1){
                        this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.userInfo=res.data.data;
                        // 成人
                        this.form.nickname=this.userInfo.nickname;
                        this.form.fullname=this.userInfo.fullname;
                        this.form.mobile=this.userInfo.mobile;
                        this.form.email=this.userInfo.email;
                        this.form.gender=this.userInfo.memberdetail.gender;
                        this.form.province=this.userInfo.memberdetail.giftprovince;
                        this.form.cityname=this.userInfo.memberdetail.giftcity;
                        this.form.district=this.userInfo.memberdetail.giftdistrict;
                        this.form.address.push(this.userInfo.memberdetail.giftprovince,this.userInfo.memberdetail.giftcity,this.userInfo.memberdetail.giftdistrict);
                        this.form.daxue=this.userInfo.memberdetail.daxue;
                        this.form.gongsi=this.userInfo.memberdetail.gongsi;
                        this.form.job=this.userInfo.memberdetail.job;
                        this.form.zhiwei=this.userInfo.memberdetail.zhiwei;
                        this.form.qq=this.userInfo.memberdetail.qq;
                        this.form.skypenum=this.userInfo.memberdetail.skypenum;
                        this.form.isfirststudy=this.userInfo.memberdetail.isfirststudy;
                        this.form.age=this.userInfo.memberdetail.age;
                        this.form.studyfrom=this.userInfo.memberdetail.studyfrom;
                        this.form.studylevel=this.userInfo.memberdetail.studylevel;
                        this.form.wanttostudy=this.userInfo.memberdetail.wanttostudy;
                        this.form.highscore=this.userInfo.memberdetail.highscore;
                        this.form.studyextension=this.userInfo.memberdetail.studyextension;
                        this.form.studyhigh=this.userInfo.memberdetail.studyhigh;
                        this.form.studyshijian=this.userInfo.memberdetail.studyshijian;        
                        this.form.groupid=this.userInfo.groupid;
                        this.form.targetlevel=this.userInfo.memberdetail.targetlevel;
                        this.form.iwant=this.userInfo.memberdetail.iwant;              
                        this.form.level=this.userInfo.memberdetail.level;
                        this.form.firstpay=this.userInfo.memberdetail.firstpay;
                        this.form.tutorcomment=this.userInfo.memberdetail.tutorcomment;
                        this.form.status=this.userInfo.status;
                        this.form.budget=this.userInfo.memberdetail.budget;

                        //少儿
                        this.form.username=this.userInfo.username;
                        this.form.regdate=this.userInfo.regdate;
                        this.form.lastdate=this.userInfo.lastdate;
                        this.form.loginnum=this.userInfo.loginnum;
                        this.form.sendmail=this.userInfo.sendemail;
                        // this.form.birthday=this.userInfo.memberdetail.birthday;
                        this.form.toycartoon=this.userInfo.memberchild.toycartoon;
                        this.form.grade=this.userInfo.memberchild.grade;
                        this.form.birthday=this.userInfo.memberchild.birthyear+'-'+this.userInfo.memberchild.birthmonth+'-'+this.userInfo.memberchild.birthdate;
                        this.form.character=this.userInfo.memberchild.character;
                        // this.form.address=this.userInfo.memberdetail.giftprovince+'-'+this.userInfo.memberdetail.giftcity+'-'+this.userInfo.memberdetail.giftdistrict;
                        this.form.dadname=this.userInfo.memberchild.dadname;
                        this.form.dadage=this.userInfo.memberchild.dadage;
                        this.form.dadjobs=this.userInfo.memberchild.dadjob;
                        this.form.dadmobile=this.userInfo.memberchild.dadmobile;
                        this.form.mumname=this.userInfo.memberchild.mumname;
                        this.form.mummobile=this.userInfo.memberchild.mummobile;
                        this.form.mumage=this.userInfo.memberchild.mumage;
                        this.form.mumjob=this.userInfo.memberchild.mumjob;
                        this.form.familyincome=this.userInfo.memberchild.familyincome;
                        this.form.alreadystudy=this.userInfo.memberdetail.isfirststudy;
                        this.form.stratway=this.userInfo.memberchild.stratway;
                        this.form.withforeign=this.userInfo.memberchild.withforeign;
                        this.form.studytime=this.userInfo.memberchild.learnedtime;
                        this.form.foreigntime=this.userInfo.memberchild.foreigntime;
                        this.form.schoolname=this.userInfo.memberchild.schoolname;
                        this.form.englishrank=this.userInfo.memberchild.englishrank;
                        this.form.englishlevel=this.userInfo.memberchild.englishlevel;
                        this.form.expects=this.userInfo.memberchild.expect;
                        this.form.improvefields=this.userInfo.memberchild.improvefields;
                        this.form.considerfield=this.userInfo.memberchild.considerfield;
                        this.form.weekTime=this.userInfo.memberchild.weektime;
                        this.form.suitabletime=this.userInfo.memberchild.suitabletime;
                        this.form.monthbudget=this.userInfo.memberchild.monthbudget;
                        this.form.teachernote=this.userInfo.memberdetail.tutorcomment;
                        this.form.finishtime=this.userInfo.memberdetail.studyshijian;
                        this.form.budget=this.userInfo.memberdetail.studymoney;
                        this.form.englishlevel=this.userInfo.memberdetail.studylevel;
                        this.form.appeal=this.userInfo.memberdetail.iwant;
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            // 获取回访记录
            getRecord(){
                this.$axios({
                    url: base.baseUrl+"/school/member/get-visit",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        userid:this.userid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                   if(res.data.code==200){
                       this.gotRecord=res.data.data
                   }
                });
            },
            // 儿童表单
            getChildform(){
                this.$axios({
                    url: base.baseUrl+"/school/member/get-student-setting ",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        user_role:'child'
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    // console.log(res);
                    if(res.data.code==200){
                        this.childData=res.data.data;
                    }
                });
            },
            // 成人
            getAdultform(){
                this.$axios({
                    url: base.baseUrl+"/school/member/get-student-setting ",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    // console.log(res);
                    if(res.data.code==200){
                        this.fromLabel=res.data.data;
                    }
                });
            },
            getGrade(){
                this.$axios({
                    url: base.baseUrl+"/school/setting/get-class",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        attid: this.form.xuenianid,
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.grade_lists=res.data.data;
                    };
                }); 
            },

            dialogChange(){
                this.dialogFormVisible2=false
            },
            closeAndClear(){
                this.dialogFormVisible2=false
                this.inCloseandClear()
            },
            inCloseandClear(){
                // this.form1.areaid=''
                this.form1.classtool=''
                this.form1.gender=''
                this.form1.chineselevel=''
                this.form1.professional=''
                this.form1.startdate=''
                this.form1.timeArr=[]
                this.transferdata=this.form1.studyplan=[]
                this.course1id=this.course2id=this.course3id=''
                this.c2show=this.c3show=this.c4show=this.c5show=this.c6show=false,
                this.form1.termlen=''
                this.courseid=0
                this.pageDivide=false
                this.tags=this.form1.testTime=this.avaTeacher=[]
                this.form1.classtoolnum=''
            },
            inClearSy(){
                this.form1.classtool=''
                this.form1.gender=''
                this.form1.chineselevel=''
                this.form1.enddate=''
                this.form1.startdate=''
                this.form1.coursewareid=''
                this.course1id=this.course2id=this.course3id=''
                this.course4id=this.course5id=this.course6id=''
                this.c2show=this.c3show=this.c4show=this.c5show=this.c6show=false,
                this.courseid=0
                this.pageDivide=false
                this.form1.professional=''
                this.avaTeacher2=[]
            },
            clearSanyue(){
                this.SdialogFormVisible=false
                this.inClearSy()
            },
            doRefresh(){
                this.getForclassList()
            },
            dialogChange(){
                this.dialogFormVisible2=false
            },
            onSubmit() {
                // console.log(this.formInline);
            },
            handleCurrentChange(val) {
                this.loading2=true
                this.cur_page=val;
                this.getForclassList();
            },
            handleCurrentChange2(val) {
                this.cur_page2=val;
                this.avaTeacher2=[]
                this.syTeacher();
            },
            handleCurrentChange3(val) {
                this.cur_page3=val;
                this.avaTeacher=[]
                this.toSearch();
            },
            // 获取正式班列表
            getForclassList(){
                this.$axios({
                    url: base.baseUrl+"/school/class/get-class-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classtype:2,
                        p:this.cur_page,
                        page_size:this.page_size
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    // console.log(res);
                    if(res.data.code==200){
                        this.formalData=(res.data.data)[0].class_list;
                        this.loading2=false
                        this.totalCount=Number((res.data.data)[0].pages.total_count);
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                }); 
            },
            // 搜索正式班
            searchClassList(){
                this.$axios({
                    url: base.baseUrl+"/school/class/get-class-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classtype:2,
                        key_word:this.formInline.key_word,
                        p:this.cur_page,
                        page_size:this.page_size
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.status==500){
                        this.alertTip('服务器出错')
                    }else{
                        if(res.data.code==200){
                            this.formalData=(res.data.data)[0].class_list;
                            this.totalCount=Number((res.data.data)[0].pages.total_count);
                        }else if(res.data.code==-2){
                            this.$router.push('/login')
                        }
                    }
                }); 
            },
            editClass(cid){
                this.classid=cid;
                this.dialogFormVisible1 = true;
                this.getExclassInfo()
                this. getStudentList()
            },
            //班级课表
            classTable(cid){
                this.dialogFormVisible8=true
                this.groupclassid=cid
                this.now_date=new Date().getTime()
                this.date_time=this.now_date.toString();
                this.getClassTable() 
            },
            getClassTable(){
                this.$axios({
                    url: base.baseUrl+"/school/class-time-table/get-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        groupclassid:this.groupclassid,
                        date_time:(this.date_time).substr(0,10)
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==-1){
                        this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.experienceData2=res.data.data
                    }
                });
            },
            nextTable(){
                this.now_date=this.now_date+7 * 24 * 3600 * 1000
                this.date_time=this.now_date.toString();
                this.getClassTable() 
            },
            backTable(){
                this.now_date=this.now_date-7 * 24 * 3600 * 1000
                this.date_time=this.now_date.toString();
                this.getClassTable() 
            },
            //获取班级详情
            getExclassInfo(){
                this.getTeacherList()
                this.getSaleList()
                this.$axios({
                    url: base.baseUrl+"/school/class/get-class-info",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        // id:239
                        id:this.classid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.classDetail=res.data.data;
                        this.allStudents=res.data.data.student_ids;
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            getTeacherList(){
                this.$axios({
                    url: base.baseUrl+"/school/agent/get-role-name",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        role:2
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.teacherList=res.data.data;
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            getSaleList(){
                this.$axios({
                    url: base.baseUrl+"/school/agent/get-role-name",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        role:18
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.saleList=res.data.data;
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            // 解散班级
            removeClass(cid){
                this.classid=cid;
                // this.dialogFormVisible4=true
                this.$confirm(this.removeTip, '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                   this.confirmRemove()
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });          
                });
            },
            confirmRemove(){
                this.$axios({
                    url: base.baseUrl+"/school/class/class-ops",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        id:this.classid,
                        act:'remove'
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.status==500){
                        this.alertTip('服务器出错')
                    }else{
                        if(res.data.code==-1){
                            this.alertTip(res.data.msg)
                        }else if(res.data.code==200){
                            this.alertTip('解散成功')
                        }
                    }
                });
            },
            //预约正式课
            reserverClass(cid){
                this.classid=cid
                this.form1.classid=cid
                this.dialogFormVisible2=true

                // this.dialogHidden=false
                this.inCloseandClear()
                this.getTeacherOpt()
                this.getCourseList()
                this.getClassSelect()
            },
            // 获取班级下拉列表
            getClassSelect(){
                 this.$axios({
                    url: base.baseUrl+"/school/class/get-class-select",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classtype:2
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.classSelect=res.data.data
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            // 获取老师属性
            getTeacherOpt(){
                 this.$axios({
                    url: base.baseUrl+"/school/course/get-teacher-opt",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.professional=res.data.data.professional;
                        this.area=res.data.data.area;
                        this.chineselevel=res.data.data.chineselevel;
                        this.form1.classTool=res.data.data.classtool

                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            //添加成功后获取班级学员
            getStudentList(zi){
                if(zi){
                    this.getExclassInfo()
                }else{
                    this.$axios({
                        url: base.baseUrl+"/school/class/get-class-student-list",
                        method: "POST",
                        header: { 'content-type': 'application/x-www-form-urlencoded' },
                        data:{
                            token:localStorage.token,
                            classid:this.classid
                        },
                        transformRequest: [function (data) {
                            let ret = ''
                            for (let it in data) {
                                ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                            }
                            return ret
                        }],
                    }).then(res => {
                        if(res.data.code==200){
                            this.studentList=res.data.data;
                            // this.addedTable=ifshow
                        }else if(res.data.code==-2){
                            this.$router.push('/login')
                        }
                    });
                }
            },
            //移出班级
            outClass(cid,sid){
                this.$axios({
                    url: base.baseUrl+"/school/class/del-students-to-class",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        class_id:cid,
                        student_id:sid,
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.status==500){
                        this.alertTip('服务器出错')
                    }else{
                        if(res.data.code==-1){
                            this.alertTip(res.data.msg)
                        }else if(res.data.code==200){
                            this.alertTip('移出成功')
                            this. getStudentList()
                        }
                    }
                });
            },
            submitEdit(){
                this.dialogFormVisible1=false
                this.$axios({
                    url: base.baseUrl+"/school/class/set-class",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        id:this.classid,
                        name:this.classDetail.name,
                        assistant:this.classDetail.assistant,
                        saleid:this.classDetail.saleid,
                        remark:this.classDetail.remark,
                        classtype:1
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.status==500){
                        this.alertTip('服务器出错')
                    }else{
                        if(res.data.code==-1){
                            this.alertTip(res.data.msg)
                        }else if(res.data.code==200){
                            this.alertTip('编辑成功')
                        }
                    }
                });
            },
            // 课程联动
            getCourseList(){
                this.$axios({
                    url: base.baseUrl+"/school/course/get-course-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classid:this.classid,
                        coursewareid:this.courseid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.course1=res.data.data;
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            course1Change(e){
                this.transferdata=[]
                this.course2id=this.course3id=this.course4id=this.course5id=this.course6id=''
                this.courseid=e;                
                this.getCourse2()
            },
            getCourse2(){
                this.$axios({
                    url: base.baseUrl+"/school/course/get-course-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classid:this.classid,
                        coursewareid:this.courseid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        if(res.data.data==null){
                            this.form1.coursewareid=this.course1id
                        }else{
                            this.c2show=true
                            this.course2=res.data.data;
                        } 
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            course2Change(e){
                this.transferdata=[]
                this.course3id=this.course4id=this.course5id=this.course6id='' 
                this.courseid=e;
                this.getCourse3()   
            },
            getCourse3(){
                this.$axios({
                    url: base.baseUrl+"/school/course/get-course-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classid:this.classid,
                        coursewareid:this.courseid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        if(res.data.data==null){
                            this.form1.coursewareid=this.course2id
                            this.originData=this.course2
                            this.doDeal()
                        }else{
                            this.course3=res.data.data;
                            this.c3show=true
                        } 
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            course3Change(e){
                this.transferdata=[]
                this.course4id=this.course5id=this.course6id=''
                this.courseid=e;
                this.getCourse4()         
            },
            getCourse4(){
                this.$axios({
                    url: base.baseUrl+"/school/course/get-course-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classid:this.classid,
                        coursewareid:this.courseid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        if(res.data.data==null){
                            this.form1.coursewareid=this.course3id
                            this.originData=this.course3
                            this.doDeal()
                            if(this.SdialogFormVisible==false){
                                this.c3show=false
                            }else{
                                this.c3show=true
                            }
                        }else{
                            this.course4=res.data.data;
                            this.c4show=true
                        } 
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            course4Change(e){
                this.transferdata=[]
                this.course5id=this.course6id=''
                this.courseid=e;
                this.getCourse5()                
            },
            getCourse5(){
                this.$axios({
                    url: base.baseUrl+"/school/course/get-course-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classid:this.classid,
                        coursewareid:this.courseid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        if(res.data.data==null){
                            this.form1.coursewareid=this.course4id
                            this.originData=this.course4
                            this.doDeal()
                            if(this.SdialogFormVisible==false){
                                this.c4show=false
                            }else{
                                this.c4show=true
                            }
                        }else{
                            this.course5=res.data.data;
                            this.c5show=true
                        } 
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            course5Change(e){
                this.transferdata=[]
                this.course6id=''
                this.courseid=e;
                this.getCourse6()      
            },
            getCourse6(){
                this.$axios({
                    url: base.baseUrl+"/school/course/get-course-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classid:this.classid,
                        coursewareid:this.courseid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        if(res.data.data==null){
                            this.form1.coursewareid=this.course5id
                            this.originData=this.course5
                            this.doDeal()
                            if(this.SdialogFormVisible==false){
                                this.c5show=false
                            }else{
                                this.c5show=true
                            }
                        }else{
                            this.course6=res.data.data;
                            this.c6show=true
                        } 
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            course6Change(e){
               this.form1.coursewareid=e    
               this.originData=this.course6
            //    console.log(this.course6)
               this.doDeal()
            },
            doDeal(){
                for( var index in this.originData){
                    this.transferdata.push({
                        id:'',
                        title:''
                    })
                    this.transferdata[index].title=this.originData[index].title
                    this.transferdata[index].id=this.originData[index].id    
                } 
            },
            transChange(){
                console.log(11)
            },
            searchTeacher(){
                this.forTparr()
                // this.dialogHidden=true
                if(this.form1.classtool){
                    this.toSearch()
                }else{
                    this.alertTip('请选择上课工具')
                }
            },
            forTparr(){
                for( var index in this.form1.timeArr){
                    this.form1.timeArr[index].timeperweek=(this.form1.timeArr[index].timeperweek1)+'-'+(this.form1.timeArr[index].timeperweek2)
                    this.form1.tpArr.push(this.form1.timeArr[index].timeperweek)
                }
                for(var i=0;i<this.form1.tpArr.length;i++){
                    if(this.form1.tpArr2.indexOf(this.form1.tpArr[i])==-1){
                        this.form1.tpArr2.push(this.form1.tpArr[i])
                    }
                }
            },
            toSearch(){
                if(this.kkTable==false){
                    this.alertTip('请先确认上课时间')
                }else{
                    this.pageDivide=true
                    this.$axios({
                        url: base.baseUrl+"/school/course/normal-teacher-list",
                        method: "POST",
                        header: { 'content-type': 'application/x-www-form-urlencoded' },
                        data:{
                            token:localStorage.token,
                            isscatter:0,
                            classid:this.form1.classid,
                            areaid:this.form1.areaid,
                            classtool:this.form1.classtool,
                            gender:this.form1.gender,
                            chineselevel:this.form1.chineselevel,
                            professional:this.form1.professional,
                            startdate:this.form1.startdate,
                            studyplan:this.form1.sendArry,
                            // timeperweek:this.form1.tpArr2,
                            // studyplan:this.form1.studyplan,
                            coursetimes:this.form1.testTime,
                            pagenum:this.cur_page3,
                            pagesize:this.page_size2,
                            classtoolnum:this.form1.classtoolnum
                            // termlen:this.form1.termlen,
                            // timeperweek:this.form1.tpArr2,
                            // passholiday:this.form1.passholiday
                        },
                        transformRequest: [function (data) {
                            let ret = ''
                            for (let it in data) {
                                ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                            }
                            return ret
                        }],
                    }).then(res => {
                        this.form1.tpArr3=this.form1.tpArr2    
                        this.form1.tpArr = []
                        this.form1.tpArr2 = []
                        if(res.status==500){
                            this.alertTip('服务器出错')
                        }else{
                            if(res.data.code==-1){
                                this.alertTip(res.data.msg)
                            }else if(res.data.code==200){
                                this.avaTeacher=res.data.data.teacherlist
                                this.totalCount3=Number(res.data.data.pages.total_count);
                                if(this.avaTeacher.length==0){
                                    this.alertTip('暂无符合条件的外教')
                                }
                            }else if(res.data.code==-2){
                                this.$router.push('/login')
                            }
                        }
                    });
                }
            },
            // 增加、删减时间
            addTime(){
                this.form1.timeArr.push({
                    timeperweek1:'',
                    timeperweek2:''
                })
            },
            delRow(index){
                this.form1.timeArr.splice(index,1)
            },
            syAndClear(cid){
                this.classid=cid
                this.form1.classid=cid
                this.getTeacherOpt()
                this.getCourseList()
                this.getClassSelect()
                this.SdialogFormVisible=true
                this.inClearSy()
            },
            //散约正式课
            syTeacher(){
                this.pageDivide=true
                this.$axios({
                    url: base.baseUrl+"/school/course/normal-teacher-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        isscatter:1,
                        // classid:262,
                        classid:this.form1.classid,
                        areaid:this.form1.areaid,
                        classtool:this.form1.classtool,
                        gender:this.form1.gender,
                        chineselevel:this.form1.chineselevel,
                        enddate:this.form1.enddate,
                        startdate:this.form1.startdate,
                        // coursewareid:7218,
                        coursewareid:this.form1.coursewareid,
                        professional:this.form1.professional,
                        pagenum:this.cur_page2,
                        pagesize:this.page_size2
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.status==500){
                        this.alertTip('服务器出错')
                    }else{
                        if(res.data.code==-1){
                            this.alertTip(res.data.msg)
                        }else if(res.data.code==200){
                            if(res.data.data==null){
                                this.alertTip('暂无可用的老师')
                            }
                            this.avaTeacher2=res.data.data.teacherlist
                            this.totalCount2=Number(res.data.data.pages.total_count);
                        }else if(res.data.code==-2){
                            this.$router.push('/login');
                        }
                    }
                });
            },
            alertTip(msg){
                this.$alert(msg, '提示', {
                    confirmButtonText: '确定',
                    // callback: action => {
                    //     this.$message({
                    //         type: 'info',
                    //     });
                    // }
                });
            }
        },
        filters:{
            transData(time){
                return formatDate(new Date(time * 1000), 'yyyy-MM-dd hh:mm');
            },
            transYear(time){
                return formatDate(new Date(time * 1000), 'yyyy-MM-dd');
            },
            transHour(time){
                return formatDate(new Date(time * 1000), 'hh:mm');
            }
        },
        created(){
            this.getForclassList()
        }
    }
</script>
<style lang="less" scoped>
    .page_blocksy{
        text-align: right;
    }
    .page_block{
        position: absolute;
        margin-top:12px;
        right: 5%;
    }
    .timeLimitTip{
        margin-left: 80px;
        margin-bottom: 16px;
        color:#ff5263;
    }
    .circle_close{
        background: none;
        border: none;
        outline: none;
        float: right;
    }
    .tuozhuai{
        display: flex;
        text-align: center;
        // justify-content: center;
    }
    .kejian{
        border:1px solid #dcdfe6;
        margin-right: 20px;
    }
    .kejian,.plan-list{
        width:320px;
    }
    .kejian>div{
        // height: 40px;
        line-height: 40px;
        padding: 0 10px;
        border-bottom: 1px solid #dcdfe6;
    }
    .plan-list{
        border:1px dashed #dcdfe6;
        // border-bottom: none;
    }
    .testdiv{
        // height: 40px;
        line-height: 40px;
        background: #f5f7fa;
        border-bottom: 1px dashed #dcdfe6;
    }
    .differ{
        font-size: 18px;
        font-family: '黑体';
    }
    @media screen and (max-width:1700px){
        .el-form--inline{
            width: 1400px;
        }  
    }
    .confirm_data{
        font-size: 18px;
        margin-right: 20px;
    }
    .formalClass{
        .experience_inputs{
            height: 60px;
            box-sizing: border-box;
            background: #f5f5f5;
            padding-top: 10px;
            display: flex;
            .creatBtn{
                width: 240px;
                cursor: pointer;
            }
            .operate_inputs{
                // padding: 15px 30px;
                height: 70px;
                box-sizing: border-box;
                button{
                    width: 130px;
                    height: 38px;
                    border-radius: 4px;
                    border: none;
                }
                .search_btn{       
                    background-color: #ff5263;
                }
                .reset_btn{
                    background-color: #808080;
                }
            }
        }
        .divided_3{
            margin-right: 10px;
        }
        .eg_tip{
            margin-right: 70px;
        }
        .searchTeacher{
            text-align: right;
            button{
                width: 200px;
                font-size: 16px;
            }
        }
    }
    .teacher_info{
        display: flex;
        justify-content: space-around;
        flex-wrap: wrap;
        .teacher_item{
            width: 360px;
            background-color: #ffffff;
            border-radius: 7px;
            box-shadow: 0px 0px 11px 0px 
            rgba(0, 0, 0, 0.19);
            text-align: center;
            padding-bottom: 60px;
            margin-bottom: 20px;
            .line_d3{
                width: 100%;
                height: 120px;
                border-radius: 7px 7px 0 0;
                background-color: #d3d3d3;
            }
            .teacher_img{ 
                // background: #ff5263;
                margin-top: -70px;
                // position: relative;
                // top:-70px; 
                // margin: 0 auto;
                img{
                    width: 140px;
                    height: 140px;
                    border: solid 10px #ffffff;
                    border-radius: 100px;
                }
            }
            .teacher_name{
                font-size: 24px;
                line-height: 36px;
                color: #4d4d4d;
            }
            .teacher_intro{
                font-size: 16px;
                line-height: 32px;
                color: #999999;
            }
            button{
                width: 200px;
                font-size: 16px;
                margin: 5px 0;
            }
        }
    }
    .fail_reserve{
        margin: 20px 40px;
    }
    .bottom_4{
        margin-bottom: 6px;
    }
</style>

